unit CefWeb.Container;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, cefvcl, Vcl.StdCtrls;

type
  TWebContainer = class(TForm)
    Chromium: TChromium;
    Panel1: TPanel;
    lblSize: TLabel;
    Button1: TButton;
    Button2: TButton;
    procedure FormResize(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;


implementation

{$R *.dfm}

procedure TWebContainer.Button1Click(Sender: TObject);
var
  rect: TRect;
begin
  GetWindowRect(Self.ParentWindow, rect);
  lblSize.Caption := Format('left: %d top: %d height: %d width: %d', [rect.Left,
    rect.Top, rect.Height, rect.Width])
end;

procedure TWebContainer.Button2Click(Sender: TObject);
begin
  lblSize.Caption := Format('left: %d top: %d height: %d width: %d', [Self.Left,
    Self.Top, Self.Height, Self.Width])
end;

procedure TWebContainer.FormResize(Sender: TObject);
begin
  lblSize.Caption := Format('left: %d top: %d height: %d width: %d', [Self.Left,
    Self.Top, Self.Height, Self.Width])
end;

end.
